﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Linq;

namespace SemanticEx.Tests
{
	[TestClass]
	public class ExtensionTests
	{
		[TestMethod]
		public void Can_split_an_integer_into_digits()
		{
			var value = 31415926;
			var values = value.SplitDigits().ToArray();
			Assert.AreEqual(6, values[0]);
			Assert.AreEqual(2, values[1]);
			Assert.AreEqual(9, values[2]);
			Assert.AreEqual(5, values[3]);
			Assert.AreEqual(1, values[4]);
			Assert.AreEqual(4, values[5]);
			Assert.AreEqual(1, values[6]);
			Assert.AreEqual(3, values[7]);
		}
	}
}